From 3ed38db870b71297c1deefe9f160048a5c4c4670 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Fri, 12 Mar 2004 16:03:47 +0000 Subject: [PATCH] bitkeeper revision 1.790 (4051df63N_qhNLzJhUL0q78WetTFRg) dev.c: Prevent transmitting link-local ARP packets on the wire. --- xen/net/dev.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/net/dev.c b/xen/net/dev.c index 3f3d317931..fbd9be63c9 100644 --- a/xen/net/dev.c +++ b/xen/net/dev.c @@ -1977,10 +1977,19 @@ static int get_tx_bufs(net_vif_t *vif) * some 169.254.* (ie. link-local) packets on the wire unless we * include this explicit test. :-( */ - if ( (ntohs(*(unsigned short *)(g_data + 12)) == ETH_P_IP) && - ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == - 0xA9FE0000) ) - goto disallow_linklocal_packets; + switch ( ntohs(*(unsigned short *)(g_data + 12)) ) + { + case ETH_P_ARP: + if ( ((ntohl(*(unsigned long *)(g_data + 28)) & 0xFFFF0000) == + 0xA9FE0000) ) + goto disallow_linklocal_packets; + break; + case ETH_P_IP: + if ( ((ntohl(*(unsigned long *)(g_data + 26)) & 0xFFFF0000) == + 0xA9FE0000) ) + goto disallow_linklocal_packets; + break; + } stx = &vif->tx_shadow_ring[MASK_NET_TX_IDX(j)]; stx->id = tx.id; -- 2.30.2